
package com.x52im.rbchat.utils;

import java.util.Observer;

import android.content.Context;

import com.eva.android.VoicePlayer;

/**
 * VoicePlayer 语音播放扩展类。
 *
 * @author JackJiang
 * @since 4.3
 */
public class VoicePlayerEx extends VoicePlayer {

    public VoicePlayerEx(Context context) {
        super(context, createObsAfterCompletion(context));
    }

    public VoicePlayerEx(final Context context, boolean _useSpeeker) {
        super(context, _useSpeeker, createObsAfterCompletion(context));
    }

    private static Observer createObsAfterCompletion(final Context context) {
        // 播放结束提示音
        return (observable, data) -> PromtHelper.voiceStopedPromt(context);
    }
}
